<script setup>
import { ref, onMounted } from 'vue'
import close from '@/assets/icon/close.svg';
import moment from 'moment';
const $moment = moment;
const emit = defineEmits(['closeShade'])
defineProps({
    msg: {
        type: Array,
        default: () => []
    }
})

defineExpose({
    $moment
})

</script>
<template>
    <div class="wls-shade">
        <div class="l_d_c">
            <div class="d-lkb-c" @click.stop="emit('closeShade', '')">
                <img :src="close" alt="">
            </div>
            <div class="Species_title">
                <div></div>
                <span style="font-size:16px">查看详情</span>
            </div>
            <ul class="wls-box dbx">
                <li v-for="(i, index) in msg" :key="i.id">
                    <el-image style="width: 100%;height: 100%;" :src="i.mediaUrl" v-if="i.type == 0" :zoom-rate="1.2"
                        :preview-src-list="[i.mediaUrl]" />
                    <video v-if="i.type == 1" :src="i.mediaUrl" controls></video>
                    <audio v-if="i.type == 3" :src="i.mediaUrl" style="width: 100%;" controls></audio>

                    <div class="istime">
                        <span>{{ $moment(i.createTime).format('YYYY-MM-DD hh:mm:ss') }}</span>
                    </div>

                </li>
            </ul>
        </div>
    </div>
</template>
<style scoped>
.wls-shade {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, .5);
}

.l_d_c {
    width: 1400px;
    height: 800px;
    padding: 24px;
    border-radius: 4px;
    position: relative;
    background: #FFF;
    overflow: hidden;
}

.d-lkb-c {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    cursor: pointer;
}


.Species_title {
    display: flex;
    align-items: center;
}

.Species_title>div:nth-child(1) {
    width: 3px;
    height: 16px;
    margin-right: 8px;
    background-color: #387BFF;
}

.wls-box {
    width: 100%;
    height: calc(100% - 44px);
    margin-top: 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.wls-box li {
    width: calc((100% - 80px) / 6);
    height: 150px;
    float: left;
    background-color: #E4E7ED;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    position: relative;
    overflow: hidden;
}

.wls-box li:nth-child(6n) {
    margin-right: 0;
}

.istime {
    width: 100%;
    height: 30px;
    line-height: 30px;
    text-align: center;
    padding: 0 5px;
    background-color: #E4E7ED;
    position: absolute;
    bottom: 4px;
    right: 0;
    border-radius: 4px;
}

.wls-box li img,
.wls-box li video {
    width: 100%;
    height: 100%;
}

/* 隐藏垂直滚动条 */
.dbx::-webkit-scrollbar {
    width: 0;
    /* 隐藏垂直滚动条 */
}

.dbx::-webkit-scrollbar-horizontal {
    display: none;
}

/* 隐藏垂直滚动条（如果有） */
.dbx::-webkit-scrollbar-vertical {
    display: none;
}

/* 隐藏滚动条的滑块 */
.dbx::-webkit-scrollbar-thumb {
    background: transparent;
}
</style>